<div class=" navbar navbar-default navbar-fixed-top" id="publicHeaderApp" th:fragment="publicHeader">
    <div class="container-fluid" >

        <div class="row">
            <div class="col-md-12 text-center" style="background-color: cornflowerblue; color: white">
                <a th:href="@{/}" style="color: white"><h3>蜗牛书店</h3></a>
            </div>
        </div>


        <div class="row" style="margin-top: 10px;margin-bottom: 10px">

            <div class="col-md-4 text-center">
                <button class="btn btn-primary" data-toggle="modal" data-target="#myModal" @click="clearAddForm">新增图书</button>
            </div>

        </div>

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">新增图书</h4>
                    </div>
                    <div class="modal-body">
                        <form>
                            <div class="form-group">
                                <label for="typeId">图书类型</label>
                                <select class="form-control" id="typeId" placeholder="请选择类型" v-model="typeId">
                                    <option value="-1">请选择类型</option>
                                    <option v-for="bookType in bookTypes" :value="bookType.id" v-text="bookType.name"></option>
                                </select>
                            </div>

                            <div class="form-group">
                                <label for="name">书名</label>
                                <input type="text" v-model="name" class="form-control" id="name" placeholder="请输入书名">
                            </div>

                            <div class="form-group">
                                <label for="provider">出版社</label>
                                <input type="text" v-model="provider" class="form-control" id="provider" placeholder="请输入出版社">
                            </div>

                            <div class="form-group">
                                <label for="author">作者</label>
                                <input type="text" v-model="author" class="form-control" id="author" placeholder="请输入作者名">
                            </div>
                            <div class="form-group">
                                <label for="price">价格</label>
                                <input type="text" v-model="price" class="form-control" id="price" placeholder="请输入价格">
                            </div>
                            <div class="form-group">
                                <label for="detail">描述</label>
                                <input type="text" v-model="detail" class="form-control" id="detail" placeholder="请输入描述">
                            </div>
<!--                            <div class="form-group">-->
<!--                                <input type="file" v-model="imgsrc" class="form-control">-->
<!--                            </div>-->
                            <div class="form-group">
                                <label for="storecount">库存数量</label>
                                <input type="text" v-model="storecount" class="form-control" id="storecount" placeholder="请输入库存">
                            </div>
                        </form>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" @click.prevent="saveBook">保存</button>
                    </div>
                </div>
            </div>
        </div>

    </div>

</div>